import type {
  BannerItem,
  CategoryItem,
  PageResult,
  GuessYouLikeItem,
  HotItem,
  PageParams,
} from '@/types/home'
import { request } from '@/utils/http'

/**
 * 首页广告区域
 * @param distributionSite 广告区域展示位置
 * @returns
 */
export const getHomeBanner = (distributionSite = 1) => {
  return request<BannerItem[]>({
    url: '/home/banner',
    method: 'GET',
    data: {
      distributionSite,
    },
  })
}

/**
 * 首页分类
 * @returns
 */
export const getHomeCategory = () => {
  return request<CategoryItem[]>({
    url: '/home/category/mutli',
    method: 'GET',
  })
}

/**
 * 首页热门推荐
 * @returns
 */
export const getHot = () => {
  return request<HotItem[]>({
    url: '/home/hot/mutli',
    method: 'GET',
  })
}

/**
 * 猜你喜欢
 * @param data
 * @returns
 */
export const getGuessYouLike = (data?: PageParams) => {
  return request<PageResult<GuessYouLikeItem>>({
    url: '/home/goods/guessLike',
    method: 'GET',
    data,
  })
}
